package dao;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Transaction;

import systemServer.reproduction.Play;

public class PlayDAO {
	public static PlayDAO instance = new PlayDAO();
	private PlayDAO (){
	}
	public static PlayDAO getInstance (){
		return instance;
	}
	public void addPlay (Play p){
		Transaction tx = Temp.pm.currentTransaction();
		try {
			tx.begin();
			Temp.pm.makePersistent(p);
			tx.commit();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (tx.isActive()) {
				tx.rollback();
			}
		}
	}
}
